/*
 * @(#) LogoutAction.java 2010-8-27
 *
 * Copyright (c) 2010, Strong Technology. All Rights Reserved.
 * Strong Technology. CONFIDENTIAL
 */
package cn.strong.gweva.common.presentation.action;

import cn.strong.gweva.common.util.Constants;

import com.opensymphony.xwork2.ActionContext;

/**
 * 退出Action
 * 
 * @author lilanfei
 * @version 1.0
 * @since 2010-09-02
 */
public class LogoutAction extends BaseAction {

	/** serialVersionUID */
	private static final long serialVersionUID = 2880130636016421559L;

	/**
	 * 清除session中的user信息
	 */
	public String execute() {
		try
		{			
			if (!this.isTimeout())
			{			
				// 清除Session
				ActionContext.getContext().getSession().clear();
				ActionContext.getContext().getSession().remove(Constants.SESSION_LOGIN_USER_INF);
			}
		}
		catch (Exception ex)
		{
			log.error(ex.toString());
		}
		return SUCCESS;
	}

}
